<?php
/**
 * Introduction: 订单日志表  order_log
 */

namespace Common\Model;


use Think\Model;

class OrderLogModel extends Model
{
    //定义数据库连接信息
    protected $connection;

    //定义表名
    protected $tableName = 'order_log';

    /**
     * 初始化
     */
    public function _initialize()
    {

        $this->connection = C('Databaese');

    }

    /**
     * 写入订单日志
     * @param unknown $orderId
     * @param unknown $desc
     * @param unknown $behavior
     * @return boolean
     */
    public function insertOneLog($orderId,$desc,$behavior){
        $data['order_id'] = $orderId;
        $data['admin_name'] = '顾客';
        $data['text']   = $desc;
        $data['behavior'] = $behavior;
        $id = $this->add($data);

        return $id;
    }
}